<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    手机号码： <input type="number"> <button>发送</button>
</body>
<script>
    let button = document.querySelector('button');
    let input = document.querySelector('input');
    let goal = null;
    button.addEventListener('click', function() {
        button.disabled = true;
        goal = new Date().getTime() + 5000;
        setInterval(coutDown(goal), 1000);
    })

    function coutDown(goal) {
        console.log('来了');
        let now = new Date().getTime();
        let cha = (goal - now) / 1000;
        let s = parseInt(cha % 60);
        s = s < 10 ? '0' + s : s;
        button.innerHTML = '请' + s + '秒后再试';
    }
</script>

<!-- <script>
    let button = document.querySelector('button');
    let input = document.querySelector('input');
    let timer = 5;
    button.addEventListener('click', function() {
        this.disabled = true;
        let down = function() {
            if (timer == 0) {
                clearInterval(interval);
                button.innerHTML = '发送';
                button.disabled = false;
                timer = 5;
            } else {
                button.innerHTML = '请' + timer + '秒后再试';
                timer--;
            }
        }
        down();
        let interval = setInterval(down, 1000)
    })
</script> -->

</html>